/*
 * @(#)ListDmsEmailArchiveAction.java
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */

package com.dcivision.dms.web;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.dcivision.framework.GlobalConstant;
import com.dcivision.framework.SystemFunctionConstant;
import com.dcivision.framework.web.AbstractListAction;

/**
ListDmsEmailAuditTrailAction

This class about display email audit trail list.

@author      barbin tao
@company     DCIVision Limited
@creation date   13/09/2006
@version     $Revision: 1.1 $
*/

public class ListDmsEmailAuditTrailAction extends AbstractListAction {
  
  public ListDmsEmailAuditTrailAction() {
    super();
    this.setListName("dmsEmailAuditTrailList");
  } 
	/**
   * getMajorDAOClassName
   * 
   * @return The class name of the major DAObject will be used in this action.
   */
  public String getMajorDAOClassName() {
    return ("com.dcivision.dms.dao.DmsEmailAuditTrailDAObject");
  }

  /**
   * getFunctionCode
   * 
   * @return The corresponding system function code of action.
   */
  public String getFunctionCode() {
    return (SystemFunctionConstant.DMS_EMAIL_AUDIT_TRAIL);
  }
  
  /***********************
   * this struts action forward the jsp page
   */
  public ActionForward execute(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response)throws ServletException { 
    ListDmsEmailAuditTrailForm emailAuditForm = (ListDmsEmailAuditTrailForm)form;
    request.setAttribute("FUNCTION_CODE",this.getFunctionCode());
    request.setAttribute(GlobalConstant.ACTION_MODE,"L");
    emailAuditForm.setSortAttribute("SENT_DATE");
    emailAuditForm.setSortOrder("DESC");
    return mapping.findForward("L"); 
  }
  
}
